﻿@model mesoBoard.Framework.Models.UserProfileViewModel

@{
    Layout = "~/Views/Shared/_Site.cshtml";
}

<div class="user_profile section">
    <h2>@Model.User.Username 's profile</h2>

        <div class="left_column">
            <h4>
                @Html.UsernameLink(Model.User) 
            </h4>

            @if(!string.IsNullOrWhiteSpace(Model.Profile.Avatar))
            { 
                <div class="avatar">
                    @Html.UserAvatar(Model.User.UserID) 
                </div>
            } 

            <div class="rank">
                @Html.UserRank(Model.User) 
            </div>

            <ul>
                <li>@Html.ActionLink("Private Message", "SendMessage", "Messages", new { ToUserName = Model.User.Username }, null)</li>
                <li>@Model.User.Posts.Count posts</li>
                <li>Joined: @Model.User.RegisterDate.ToString("MMM yyyy")</li>
            </ul>
        </div>

        <div class="right_column">
            <ul>                    
                <li>Location: @Model.Profile.Location  </li>
                <li>AIM: @Model.Profile.AIM </li>
                <li>ICQ: @Model.Profile.ICQ </li>
                <li>MSN: @Model.Profile.MSN </li>
                <li>Website: @Model.Profile.Website </li>
            </ul>

            <ul>
                <li>Last Post: 
                    @if (Model.LastPost == null) 
                    { 
                        <text>No posts</text>
                    } 
                    else 
                    {
                        @Html.ActionLink(Model.LastPost.Thread.Title, "ViewThread", new { controller = "Board", ThreadID = Model.LastPost.ThreadID, PostID = Model.LastPost.PostID })  
                    } 
                </li>
            </ul>

            
            @if (!string.IsNullOrWhiteSpace(Model.Profile.ParsedSignature))
            {
                <hr />
                <div class="signature">
                    @Html.Raw(Model.Profile.ParsedSignature)
                </div>
            }
                
        </div>
</div>